home *** CD-ROM | disk | FTP | other *** search
- ü
- Encrypter Routine
- ~~~~~~~~~~~~~~~~~
- ù
- So what exactly does an encrypter routine do? Well, basically it
- disguises one piece of code into another, so that when it is read into
- a binary editor, or a word processor, then you would produce some
- strange effects on-screen, yet when untangled with the right
- procedure, it will come out of the other end perfectly entact.
-
- þ
- There are several different kinds of encrypter used. The first,
- and maybe the most difficult, is for the computer to recognise certain
- words and phrases in the text, and replace them with a combination of
- characters, which may not be true ASCII. This can also be called a
- cruncher, but we are not discussing that particular subject. A more
- easier kind of encrypter, is to simply swap the values of each
- character around. This is an extremely simple task, and can fool
- anybody for a brief amount of time, unless you know the text is
- encrypted, and you are trying to uncrunch it. This is done by creating
- a table of possible characters, up to 255, and assigning them with a
- number up to 255, so that each of the different characters have a
- different number, but not necesarilly in order. Your list could look a
- ÿ
- þ
- bit like this :
-
-
- û
- A = 4
- B = 200
- C = 19
- D = 128 Etc.
-
-
- þ
- If you are using just a few letters of the alphabet, or maybe all
- the letters and numbers, then you could always assign more than one
- number to a particular letter, to make unpacking even more complicated
- unless you have the right program to uncrunch it with.
-
-
- ý
- One simple way of crunching a piece of text, is if you type out an
- AMOS program similar to the one below, remembering that the below
- version is only a brief example of how the system works. The easiest
- method to encrypt is :
-
- ÿ
- û
- ' Quick Encryption program.
-
- ' This program will only encrypt 9 letters of any piece of text.
- ' These are a-h, and CHR$(10), a character string VITAL to the
- ' ASCII System. Characters are in lower case.
-
- Do
- F$=Fsel$("","","Select the SOURCE file","to Encrypt")
- G$=Fsel$("","","Select DEST file")
-
- Open In 1,F$ : Reserve As Data 10,Lof(1)
- Reserve As Data 11,Lof(1)
- Close : Bload F$,10 : Rem Load in all of source file
-
- ' Now for the Loop
-
- LE=0
-
- Repeat
- P=Peek(Start(10)+LE)
- ÿ
- û
- If P>96 and P<105
- If P=97 : CHAR=2 : Print "Changed Value" : End If
- If P=98 : CHAR=5 : Print "Changed Value" : End If
- If P=99 : CHAR=1 : Print "Changed Value" : End If
- If P=100 : CHAR=4 : Print "Changed Value" : End If
- If P=101 : CHAR=3 : Print "Changed Value" : End If
- If P=102 : CHAR=8 : Print "Changed Value" : End If
- If P=103 : CHAR=6 : Print "Changed Value" : End If
- If P=104 : CHAR=7 : Print "Changed Value" : End If
- Else
- CHAR=P
- End If
-
- If P=10 : CHAR=252 : Print "Changed CHR$(10)" : End If
-
- Poke Start(11)+LE,CHAR
- Inc LE
- Until LE>Length(10)
-
- Bsave G$,Start(11) To Start(11)+Length(11)
- ÿ
- û
- Erase 10 : Erase 11 : Cls
- Loop
-
- þ
- The above program is only a simple version, and will only encrypt
- the letters a - h, along with CHR$(10), a character extremely vital to
- the working of ASCII. With this character disabled, the text viewer
- will place all characters onto one line. Remeber, that the encrypter
- is case sensitive, and you will have to change the values for the
- upper and lower case versions.
-
- ý
- To un-encrypt the program, simply change the IF... ENDIF
- statements around to read :
-
- û
- Repeat
- P=Peek(Start(10)+LE)
- If P>0 and P<9
- If P=2 : CHAR=97 : Print "Changed Value" : End If
- If P=5 : CHAR=98 : Print "Changed Value" : End If
- If P=1 : CHAR=99 : Print "Changed Value" : End If
- If P=4 : CHAR=100 : Print "Changed Value" : End If
- ÿ
- û
- If P=3 : CHAR=101 : Print "Changed Value" : End If
- If P=8 : CHAR=102 : Print "Changed Value" : End If
- If P=6 : CHAR=103 : Print "Changed Value" : End If
- If P=7 : CHAR=104 : Print "Changed Value" : End If
- Else
- CHAR=P
- End If
-
- If P=252 : CHAR=10 : Print "Changed CHR$(10)" : End If
-
- Poke Start(11)+LE,CHAR
- Inc LE
- Until LE>Length(10)
-
- ú
- One problem which you might encounter using this system, is the
- fact that the computer will try to change the wrong kind of
- characters, hence the need to account for ALL possible characters. For
- example, in the above programs I have only used a limited number of
- codes, so if a CHR$(5) is found for example, in the decryption, it
- will be changed to the value that CHR$(5) should be, even though the
- ÿ
- ú
- decrypter didn't change it in the first place.
-
- ø
- Well, I think that is all I can tell you really, apart from the
- fact that I will create a demonstration program to crunch a text file,
- using the characters a-z and A-Z, and I shall leave you with the
- challenge of creating the decrypter !!
-
- ü
- Happy AMOS-ing, and if you wish me to cover other subjects, such
- as multi-encryption, then why not drop me a line at the Mushroom PD
- address with a letter demanding I do so !!
-
- ú
- [Andrew "Mushroom" Kellett]
-
- ÷
- EOF
-
-